package com.sky.skyopsserver.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum HostTypeEnum {
    
    PHYSICAL("physical", "物理机"),
    VIRTUAL("virtual", "虚拟机"),
    CONTAINER("container", "容器"),
    CLOUD("cloud", "云主机");
    
    private final String type;
    private final String description;
    
    public static HostTypeEnum getByType(String type) {
        if (type == null) return null;
        for (HostTypeEnum hostType : values()) {
            if (hostType.getType().equals(type)) {
                return hostType;
            }
        }
        return null;
    }
    
    public static boolean isValid(String type) {
        return getByType(type) != null;
    }
}